import React, { ReactNode } from "react";
import styles from "./index.module.scss";

type Props = {
  /**
   * title
   */
  title: string;
  /**
   * children node
   */
  children: ReactNode;
};
/**
 * Fieldset for form components
 */
export default function Fieldset(props: Props) {
  const { title, children } = props;
  return (
    <div
      className={styles.container}
      style={{ marginTop: "8px", marginLeft: 2, marginRight: 2 }}
    >
      <fieldset className={styles.fieldset}>
        <legend
          style={{ color: "#15428b", fontWeight: "bold", marginLeft: "20px" }}
        >
          {title}
        </legend>
        {children}
      </fieldset>
    </div>
  );
}
